import java.util.Scanner;

public class c002 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String input, output;
		int n;
		
		while(sc.hasNext()) {
			input = sc.nextLine();
			n = Integer.parseInt(input);
			if(n == 0)
				return;
			
			output = "f91(" + Integer.toString(n) + ") = " + Integer.toString(f91(n));
			
			System.out.println(output);
		}
	}
	
	public static int f91(int n) {
		if( (n <= 100) )
			return f91(f91(n + 11));
		else if( (n >= 101) )
			return (n - 10);
		return 0;
	}
	
}